<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SOAP DNS Lookup Service Documentation</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            padding: 2rem;
        }
        h1, h2 {
            color: #2c3e50;
        }
        pre {
            background-color: #ecf0f1;
            padding: 1rem;
            border-radius: 5px;
        }
        code {
            font-family: Consolas, "Courier New", monospace;
        }
        ul {
            line-height: 1.8;
        }
        .note {
            background-color: #e7f3fe;
            border-left: 6px solid #2196F3;
            margin: 1rem 0;
            padding: 1rem;
        }
        a {
            text-decoration: none;
            color: #2980b9;
            font-size: 1.2rem;
            font-weight: bold;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <a href="soap-services.html">SOAP Services Home Page</a>
    <h1>SOAP DNS Lookup Service Documentation</h1>
    <p>This SOAP service allows users to perform DNS lookups using a SOAP interface.</p>

    <h2>Endpoint</h2>
    <pre><code>POST /webservices/soap/ws-dns-lookup.php</code></pre>

    <h2>Request Structure</h2>
    <p>The request body should follow this XML format:</p>
    <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:urn="urn:commandinjwsdl"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:lookupDNS&gt;
         &lt;targetHost&gt;example.com&lt;/targetHost&gt;
      &lt;/urn:lookupDNS&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</code></pre>

    <h2>Example Using Burp Repeater</h2>
    <pre><code>POST /webservices/soap/ws-dns-lookup.php HTTP/1.1
Host: mutillidae.localhost
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:commandinjwsdl#lookupDNS"
Content-Length: [length]

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:urn="urn:commandinjwsdl"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:lookupDNS&gt;
         &lt;targetHost&gt;example.com&lt;/targetHost&gt;
      &lt;/urn:lookupDNS&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</code></pre>

<h2>Example Using <code>curl</code></h2>
<pre><code>curl -X POST "http://mutillidae.localhost/webservices/soap/ws-dns-lookup.php" \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: \"urn:commandinjwsdl#lookupDNS\"" \
--data '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:urn="urn:commandinjwsdl"&gt;
&lt;soapenv:Header/&gt;
&lt;soapenv:Body&gt;
  &lt;urn:lookupDNS&gt;
     &lt;targetHost&gt;example.com&lt;/targetHost&gt;
  &lt;/urn:lookupDNS&gt;
&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'</code></pre>

    <h2>Expected Response</h2>
    <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   &lt;soap:Body&gt;
      &lt;lookupDNSResponse&gt;
         &lt;results host="example.com"&gt;
            &lt;line&gt;Server: 8.8.8.8&lt;/line&gt;
            &lt;line&gt;Address: 8.8.8.8#53&lt;/line&gt;
            &lt;line&gt;Non-authoritative answer:&lt;/line&gt;
            &lt;line&gt;Name: example.com&lt;/line&gt;
            &lt;line&gt;Address: 93.184.216.34&lt;/line&gt;
         &lt;/results&gt;
      &lt;/lookupDNSResponse&gt;
   &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</code></pre>

    <div class="note">
        <strong>Troubleshooting Tips:</strong>
        <ul>
            <li>Ensure the service is accessible at <code>mutillidae.localhost</code>.</li>
            <li>Verify that the SOAPAction header matches the one defined in the server code.</li>
            <li>Use valid hostnames or IP addresses to avoid validation errors.</li>
        </ul>
    </div>
</body>
</html>
